package com.itheima.mradix;

/**
 * @Author 王加鑫
 * @Date 2021/4/24 15:09
 * @Version 1.0
 * 数组的反转
 */
public class reverseArray {

    public static void main(String[] args) {

        int[] arr = {10,20,30,40,50,60};
        //数组的开始索引
        int start = 0;
        //数组的最后索引
        int end = arr.length-1;
        for (; start < end;) {
            int temp = arr[start];
            arr[start] = arr[end];
            arr[end] = temp;
            start++;
            end--;
        }

        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }

    }


}
